package com.pes.arcww.form;

import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.OneToMany;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name="PROFILES")
public class Profiles {

	@Id
	@Column(name = "PRO_ID", unique = true)
	@GeneratedValue
	private Integer pro_id;

	@Column(name = "PRO_TITLE", length = 45)
	private String title;
	
	@Column(name = "PRO_DESCRIPTION", length = 255)
	private String description;
	
	@OneToMany(targetEntity= Exams.class, mappedBy = "profile")
	@LazyCollection(LazyCollectionOption.FALSE)
	private Collection<Exams> examsList = new ArrayList<Exams>();
	
	@ManyToMany
	@JoinTable(name="CNT_TOPICS", joinColumns={@JoinColumn(name="pro_id_fk")}, 
	inverseJoinColumns={@JoinColumn(name="top_id_fk")})
	@LazyCollection(LazyCollectionOption.FALSE)
	private Collection<Topics> topicsList = new ArrayList<Topics>();

	public Integer getId() {
		return pro_id;
	}

	public void setId(Integer pro_id) {
		this.pro_id = pro_id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Collection<Topics> getTopicsList() {
		return topicsList;
	}

	public void setTopicsList(Collection<Topics> topicsList) {
		this.topicsList = topicsList;
	}

	public Collection<Exams> getExamsList() {
		return examsList;
	}

	public void setExamsList(Collection<Exams> examsList) {
		this.examsList = examsList;
	}
		
}
